package com.example.jwtauthdemo.webclient;


import com.example.jwtauthdemo.config.FeignMultipartConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;


@FeignClient(name = "personal-center", url = "http://localhost:9007", configuration = FeignMultipartConfig.class)
public interface PersonalServiceClient {

    // 注意这里使用的是@RequestMapping的完整路径，与服务端保持一致
    @PostMapping(value = "/personal/updateRealName", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public String updateRealName(
            @RequestPart("file") MultipartFile file,
            @RequestPart("userId") String userId);

}
